home *** CD-ROM | disk | FTP | other *** search
- Path: oxy.rust.net!usenet
- From: ebennett@rust.net
- Newsgroups: comp.lang.c
- Subject: Re: Q: realloc->free?
- Date: Tue, 16 Jan 1996 05:36:47 GMT
- Organization: Rust Net - High Speed Internet in Detroit 810-642-2276
- Message-ID: <4df2ud$706@oxy.rust.net>
- References: <4daa2e$oh5@axe.netdoor.com>
- NNTP-Posting-Host: liv-25.rust.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- esargent@netdoor.com (Eric Sargent) wrote:
-
-
-
- > Now let's say realloc had to move the data so a != b. Does realloc
- >free the memory previously pointed to by a or should it be explicitly
- >freed if realloc returns a new location? I checked the FAQ, but there
- >was nothing specific about realloc. Thanks for any information.
-
- realloc() will free the old block. It is perfectly legal to say
-
- a = realloc(a, newsize);
-
- No memory loss should occur from this.
-
- Earl
-
-
-